<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .aa {
            height: 200px;
            width: 200px;
            background-color: red;
        }
    </style>
</head>

<body>
    <div class="aa"></div>
    <script>
        /* 
           点击 div ，修改宽度 ， 和 背景颜色 
           div.style   也是一个对象
           修改行内样式    用  style 
        */

        let div = document.querySelector('div')
        div.onclick = function () {
            // console.log(div.style);
            div.style.backgroundColor = 'blue'
            div.style.width = '300px'
            div.style.height = '300px'
        }
    </script>
</body>

</html>